<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-on</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet">
    <script src="../vue.min.js"></script>
</head>
<body>
    <div class="container" id="mainConnect">
        <div class="panel panel-default">
            <div class="panel panel-default">
                  <div class="panel-heading">
                        <h3 class="panel-title">v-on</h3>
                  </div>
                  <div class="panel-body">
                    <div class="row">
                        <div class="col-xs-4">
                            <div class="form-group">
                                <label for="">v-on 输入值 : </label>
                                <input type="button" v-on:click="testEvt($event,'click')" class="form-control" value="按钮">
                            </div>
                        </div>
                        <div class="col-xs-4">
                            <div class="form-group">
                                <label for="">v-on 输出值</label>
                                <input @blur="console.log('on input blur event')" 
                                @input="console.log('on input input event')" v-model="onData" type="text" class="form-control" placeholder="Input field">
                            </div>
                        </div>
                    </div>
                  </div>
            </div>
        </div>
    </div>
    <script>
        new Vue({
            el:'#mainConnect',
            data() {
                return {
                    onData: ''
                }
            },
            methods: {
                testEvt(e,type) {
                    console.log(e)
                    console.log(type)
                    console.log(arguments) //接收全部参数
                }
            }
        })
    </script>
</body>
</html>